package com.httpDemo.doMain;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import com.alibaba.fastjson.annotation.JSONField;

import lombok.Data;

/**
 * application.yml配置文件的配置类
 * 
 * @author Administrator
 *
 */
@Component
@ConfigurationProperties(prefix = "employee")
@Data
@Validated // 验证
public class Employee {

	private Integer id;
	private String name;
	private String userName;
	private Integer age;
	private String[] hobby;
	private List<String> lists;
	private Map<String, String> maps;
	private Set<String> sets;
//	// 日期格式转化
//	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
//	// 将返回给前端的字段转换成指定的值
//	@JsonProperty("birthday")
	// 不使用jackson，使用fastjson转化
	@JSONField(name = "birthday", format = "yyyy-MM-dd HH:mm:ss")
	private Date birth;
//	@Email
	private String email;

}
